﻿using System;
using LuaInterface;

public class SendBaseMessageWrap
{
	public static void Register(IntPtr L)
	{
		LuaMethod[] regs = new LuaMethod[]
		{
			new LuaMethod("WriteByte", WriteByte),
			new LuaMethod("WriteShort", WriteShort),
			new LuaMethod("WriteInt", WriteInt),
			new LuaMethod("WriteFloat", WriteFloat),
			new LuaMethod("WriteDouble", WriteDouble),
			new LuaMethod("WriteLong", WriteLong),
			new LuaMethod("WriteString", WriteString),
			new LuaMethod("SendToServer", SendToServer),
			new LuaMethod("New", _CreateSendBaseMessage),
			new LuaMethod("GetClassType", GetClassType),
		};

		LuaField[] fields = new LuaField[]
		{
		};

		LuaScriptMgr.RegisterLib(L, "SendBaseMessage", typeof(SendBaseMessage), regs, fields, typeof(object));
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int _CreateSendBaseMessage(IntPtr L)
	{
		int count = LuaDLL.lua_gettop(L);

		if (count == 0)
		{
			SendBaseMessage obj = new SendBaseMessage();
			LuaScriptMgr.PushObject(L, obj);
			return 1;
		}
		else if (count == 1)
		{
			int arg0 = (int)LuaScriptMgr.GetNumber(L, 1);
			SendBaseMessage obj = new SendBaseMessage(arg0);
			LuaScriptMgr.PushObject(L, obj);
			return 1;
		}
		else
		{
			LuaDLL.luaL_error(L, "invalid arguments to method: SendBaseMessage.New");
		}

		return 0;
	}

	static Type classType = typeof(SendBaseMessage);

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int GetClassType(IntPtr L)
	{
		LuaScriptMgr.Push(L, classType);
		return 1;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int WriteByte(IntPtr L)
	{
		LuaScriptMgr.CheckArgsCount(L, 2);
		SendBaseMessage obj = (SendBaseMessage)LuaScriptMgr.GetNetObjectSelf(L, 1, "SendBaseMessage");
		int arg0 = (int)LuaScriptMgr.GetNumber(L, 2);
		obj.WriteByte(arg0);
		return 0;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int WriteShort(IntPtr L)
	{
		LuaScriptMgr.CheckArgsCount(L, 2);
		SendBaseMessage obj = (SendBaseMessage)LuaScriptMgr.GetNetObjectSelf(L, 1, "SendBaseMessage");
		int arg0 = (int)LuaScriptMgr.GetNumber(L, 2);
		obj.WriteShort(arg0);
		return 0;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int WriteInt(IntPtr L)
	{
		LuaScriptMgr.CheckArgsCount(L, 2);
		SendBaseMessage obj = (SendBaseMessage)LuaScriptMgr.GetNetObjectSelf(L, 1, "SendBaseMessage");
		int arg0 = (int)LuaScriptMgr.GetNumber(L, 2);
		obj.WriteInt(arg0);
		return 0;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int WriteFloat(IntPtr L)
	{
		LuaScriptMgr.CheckArgsCount(L, 2);
		SendBaseMessage obj = (SendBaseMessage)LuaScriptMgr.GetNetObjectSelf(L, 1, "SendBaseMessage");
		float arg0 = (float)LuaScriptMgr.GetNumber(L, 2);
		obj.WriteFloat(arg0);
		return 0;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int WriteDouble(IntPtr L)
	{
		LuaScriptMgr.CheckArgsCount(L, 2);
		SendBaseMessage obj = (SendBaseMessage)LuaScriptMgr.GetNetObjectSelf(L, 1, "SendBaseMessage");
		double arg0 = (double)LuaScriptMgr.GetNumber(L, 2);
		obj.WriteDouble(arg0);
		return 0;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int WriteLong(IntPtr L)
	{
		LuaScriptMgr.CheckArgsCount(L, 2);
		SendBaseMessage obj = (SendBaseMessage)LuaScriptMgr.GetNetObjectSelf(L, 1, "SendBaseMessage");
		long arg0 = (long)LuaScriptMgr.GetNumber(L, 2);
		obj.WriteLong(arg0);
		return 0;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int WriteString(IntPtr L)
	{
		LuaScriptMgr.CheckArgsCount(L, 2);
		SendBaseMessage obj = (SendBaseMessage)LuaScriptMgr.GetNetObjectSelf(L, 1, "SendBaseMessage");
		string arg0 = LuaScriptMgr.GetLuaString(L, 2);
		obj.WriteString(arg0);
		return 0;
	}

	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static int SendToServer(IntPtr L)
	{
		LuaScriptMgr.CheckArgsCount(L, 1);
		SendBaseMessage obj = (SendBaseMessage)LuaScriptMgr.GetNetObjectSelf(L, 1, "SendBaseMessage");
		obj.SendToServer();
		return 0;
	}
}

